import { http,ResponseResult } from '@/utils/request'

  // 定义返回数据接口
export interface NoticeData {
    id: number,
    title: string,
    content: string,
    createtime: string
}

export interface SignUpParams {
    mobile: string
    password: string
    confirm_password: string
    verify: string
}

export interface LoginInParams {
    username: string
    password: string
}

export interface ModifyPasswordParams {
    oldpass: string
    newpass: string
    confpass: string
}

export interface ForgetPasswordParams {
    mobile: string
    verify: string
    password: string
    confirm_password: string
}

  
  export const handleVerifyCode = (mobile: object) => {
    return http.post<ResponseResult>('/User/sendSms', mobile)
  }

//   注册
  export const handleSignUp = (params: SignUpParams) => {
    return http.post<ResponseResult>('/User/register', params)
  }

  //   登录
  export const handleLoginIn = (params: LoginInParams) => {
    return http.post<ResponseResult>('/User/login', params)
  }


//   修改密码
export const handleModifyPassword = (params: ModifyPasswordParams) => {
    return http.post<ResponseResult>('/User/passEdit', params)
}

//   忘记密码
export const handleForgetPassword = (params: ForgetPasswordParams) => {
    return http.post<ResponseResult>('/User/passForget', params)
}

